<template>
    <BTextButton type="primary" :loading="loading" @click="setR">设为已处理</BTextButton>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import { updateApi } from '@/api/FeedbackRecord'

    const props = defineProps<{
        id : number;
        status : number;
    }>()

    const emit = defineEmits<{
        (e : 'update:status', status : number) : void;
    }>()


    const loading = ref(false)

    async function setR() {
        loading.value = true
        const res = await updateApi(props.id, 1)
        loading.value = false

        emit('update:status', 1)
    }

</script>